﻿/*
   Advanced Flash Engine in ActionScript 3.
   Copyright (C) 2009  Dean Gardiner, Taylor Lodge

   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.winmastergames.lolgame {
	/* =============Class Imports============= */
	import flash.display.MovieClip;
	import flash.events.*;
	import flash.text.TextField;
	import flash.geom.Rectangle;
	import com.senocular.utils.KeyObject;
	import com.adventuresinactionscript.collisions.HitTest;
	import com.guiltfilter.utils.FramerateTracker;
	import com.winmastergames.lolgame.mapDefault

	/* =============Main Class============= */
	public class debugWindow extends MovieClip {
		/* =============Public Variables============= */
		var FPSOBJECT:FramerateTracker; //Reference of FramerateTracker Class.
		var LEVELOBJECT:mapDefault; //Reference of mapDefault Class.
		var PLAYEROBJECT:player; //Reference of player Class.

		/* =============Engine Constructor============= */
		public function debugWindow(FPSVAR:FramerateTracker, LEVELVAR:mapDefault, PLAYERVAR:player){
			addEventListener(Event.ENTER_FRAME, enterFrameHandler); //Define's listener for ENTER_FRAME Event.
			FPSOBJECT = FPSVAR; //Sets Class Reference of FramerateTracker.
			LEVELOBJECT = LEVELVAR; //Sets Class Reference of mapDefault.
			PLAYEROBJECT = PLAYERVAR; //Sets Class Reference of player.
			txt_debug1.text = "FPS: "; //Sets Default (Blank) TextField for FPS.
			txt_debug2.text = "HitBool: "; //Sets Default (Blank) TextField for HitBool.
			txt_debug3.text = "Dir: "; //Sets Default (Blank) TextField for Dir.
			txt_debug4.text = "StopDir: "; //Sets Default (Blank) TextField for StopDir.
			txt_debug5.text = "Current Weapon: "; //Sets Default (Blank) TextField for Current Weapon.
			visible = LEVELOBJECT.debugon; //Sets 'visible' variable to the one set in 'debugon'.
		} //End Constructor

		/* =============Main Engine Loop============= */
		public function enterFrameHandler(e:Event):void {
			txt_debug1.text = "FPS: " + FPSOBJECT.fps; //Loop's Variable for FPS.
			txt_debug2.text = "HitBool: " + LEVELOBJECT.hitbool; //Loop's Variable for hitbool.
			txt_debug3.text = "Dir: " + LEVELOBJECT.Dir; //Loop's Variable for Dir.
			txt_debug4.text = "StopDir: " + LEVELOBJECT.StopDir; //Loop's Variable for StopDir.
			//txt_debug5.text = "Current Weapon: " + PLAYEROBJECT.currentWeaponArray[PLAYEROBJECT.currentWeapon]; //Loop's Variable for Current Weapon.
			visible = LEVELOBJECT.debugon; //Loop's setting of 'visible' to 'debugon'.
		}
	}
}